package cn.mldn.jedis;

import redis.clients.jedis.Jedis;


/**
 * 设置 有效 时间的    数据
 * */
public class BaseExpireDateDemo {

	public static final String REDIS_HOST="";
	public static final int REDIS_PORT=6379;
	public static void main(String[] args) throws InterruptedException {
		Jedis jedis=new Jedis(REDIS_HOST,REDIS_PORT);
		jedis.setex("code-mldn", 3, "5665");
		System.out.println("取出数据："+jedis.get("code-mldn"));
		Thread.sleep(3500); //睡眠
		System.out.println("再次取出数据测试："+jedis.get("code-mldn"));
		jedis.close();  //返回  pong  则连接成功;
	}
}
